<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
      integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
        integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
        crossorigin="anonymous"></script>
<head>
    <meta charset="UTF-8">
    <title>服务器服务启动关闭脚本生成</title>
    <script>
        var flag = 0;

        function Checkall(XelementName) {
            var checkboxes = document.getElementsByName(XelementName);
            for (var i = 0; i < checkboxes.length; i++) {
                if (flag % 2 == 0)
                    checkboxes[i].checked = true;
                if (flag % 2 == 1)
                    checkboxes[i].checked = false;
                // if (flag % 3 == 2)
                //     checkboxes[i].checked = !checkboxes[i].checked;
            }
            flag++;
        }
    </script>
    <script type="text/javascript">
        function a() {
            var a = document.getElementById("path").value;
            console.log(a);
            if (a == "") {
                alert("服务根路径(必填)，请重新输入");
                return false;
            }
        }
    </script>
</head>
<body>
<form class="form-horizontal" name="form1" action="" method="get">
    <div class="form-group">
        <h1 th:inlines="text" class="text-center">服务启动及关闭脚本生成，勾选点击下载</h1>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: red">服务根路径(必填):</label>
        <div class="col-sm-4">
            <input name="path" type="text" class="form-control" value="/u01/yljhalm/yljhalm-backend"  placeholder="/u01/yljhalm/yljhalm-backend" required
                   autofocus>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">mysql的ip及端口(选填):</label>
        <div class="col-sm-4">
            <input name="mysqlIpAndPort" type="text" class="form-control" value="db.hzero.org:3306" placeholder="db.hzero.org:3306">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">mysql用户名(选填):</label>
        <div class="col-sm-4">
            <input name="mysqlName" type="text" class="form-control"  placeholder="hzero_ylj">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">mysql密码(选填):</label>
        <div class="col-sm-4">
            <input name="mysqlPassword" type="text" class="form-control"  placeholder="sLl2%%2o2O,.h">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">redis的host(选填):</label>
        <div class="col-sm-4">
            <input name="redisHost" type="text" class="form-control" value="redis.hzero.org" placeholder="redis.hzero.org">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">redis的端口(选填):</label>
        <div class="col-sm-4">
            <input name="redisPort" type="text" class="form-control" value="6379" placeholder="6379">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">redis指定仓库(选填):</label>
        <div class="col-sm-4">
            <input name="redisSchema" type="text" class="form-control" value="1" placeholder="1">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" style="color: green">redis密码(选填):</label>
        <div class="col-sm-4">
            <input name="redisPassword" type="text" class="form-control" placeholder="sLl2%%2o2O,.r">
        </div>
    </div>
    <div class="text-center">
        <input class="btn btn-default" type="button" value="全选/全不选" onclick="Checkall('model')"/></p>
    </div>

    <div id="checkBoxList" class="form-group text-center bg-success">
        <label class="col-sm-1 control-label">hzero模块</label>
        <div class="col-sm-13">
            <input type="checkbox" name="model" value="hzero-register">hzero-register
            <input type="checkbox" name="model" value="hzero-gateway">hzero-gateway
            <input type="checkbox" name="model" value="hzero-admin">hzero-admin
            <input type="checkbox" name="model" value="hzero-oauth">hzero-oauth
            <input type="checkbox" name="model" value="hzero-iam">hzero-iam
            <input type="checkbox" name="model" value="hzero-platform">hzero-platform
            <input type="checkbox" name="model" value="hzero-file">hzero-file
            <input type="checkbox" name="model" value="hzero-message">hzero-message
            <input type="checkbox" name="model" value="hzero-report">hzero-report
            <input type="checkbox" name="model" value="hzero-scheduler">hzero-scheduler
            <input type="checkbox" name="model" value="hzero-workflow-plus">hzero-workflow-plus
            <input type="checkbox" name="model" value="hzero-interface">hzero-interface
            <input type="checkbox" name="model" value="hzero-import">hzero-import
        </div>
    </div>
    <div id="checkBoxList" class="form-group text-center bg-success">
        <label class="col-sm-1 control-label">halm模块</label>
        <div class="col-sm-13">
            <input type="checkbox" name="model" value="halm-atn">halm-atn
            <input type="checkbox" name="model" value="halm-mdm">halm-mdm
            <input type="checkbox" name="model" value="halm-mmt">halm-mmt
            <input type="checkbox" name="model" value="halm-mtc">halm-mtc
            <input type="checkbox" name="model" value="halm-platform">halm-platform
            <input type="checkbox" name="model" value="halm-ppm">halm-ppm
        </div>
    </div>
    <div class="text-center">
        <input class="btn btn-primary" value="下载启动勾选服务脚本" type="submit"
               onclick="form1.action='/sh/startup/all';form1.submit();"/>
        <input class="btn btn-primary" value="下载关闭勾选服务脚本" type="submit"
               onclick="form1.action='/sh/shutdown/all';form1.submit();"/>
    </div>
    <div class="text-center">
        <h3>使用注意事项：</h3>
        <p  style="color: red" class="bg-danger"> 1. 确保输入的服务根路径已经创建。例如：/u01/yljhalm/yljhalm-backend 目录<br>
            2. 勾选服务模块，点击下载（填写页面上的数据库连接信息，各服务模块yml配置文件中已经配置的，可以删除页面预留配置信息）<br>
            3. 将启动和关闭服务的压缩包上传到服务器路径下，例如：/u01/yljhalm/yljhalm-backend下<br>
            4. 执行unzip xxx.zip -d ./xxx 把脚本解压缩到xxx目录下<br>
            5. 进入解压目录，执行move-all开头的脚本，如果没有各模块的文件夹，可以创建各个模块文件夹，并将各个模块的脚本移动至模块内部；已有则只移动脚本到各模块目录<br>
            6. 将all-service开头的脚本放到服务的根目录/u01/yljhalm/yljhalm-backend下，它是用来执行所有启动/关闭服务脚本，直接在服务的根目录下执行即可<br>
            7. 如需拓展模块，在项目index.html文件中添加input模块即可<br>
            8. 如需修改启动脚本上限制的最大内存和最小内存，修改application.yml中的vm即可
        </p>
    </div>
</form>
</body>
</html>






